package model

type ProductPurchaseRestrictions struct {
	Id int `xorm:"pk autoincr"`
	ProductId int
	ProductName string
	Interval int
	RestrictionType int
	IntervalLimit int
	SumLimit int
}

func (ppr *ProductPurchaseRestrictions)QueryProduct(pId int)(*ProductPurchaseRestrictions, error){
	var pdr ProductPurchaseRestrictions
	_, err :=x.Where("product_id = ?", pId).Get(&pdr)
	if err != nil{
		return nil, err
	}
	return &pdr, nil
}

